﻿using Entitas;

public class ActionSystem : IExecuteSystem
{
    private readonly IGroup<GameEntity> myGroup;

    public ActionSystem (Contexts contexts)
    {
        myGroup = contexts.game.GetGroup (GameMatcher.ActionComp);
    }
    
    public void Execute ()
    {
        foreach (var gameEntity in myGroup.GetEntities())
        {
            foreach (var host in gameEntity.actionComp.actionGraphHosts)
            {
                host.Excute ();
            }
        }
    }
}